﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Triunfadores.BusinessEntities;

namespace Triunfadores.Repository.Mapping
{
    public class TipoClienteMap:EntityTypeConfiguration<TipoCliente>
    {
        public TipoClienteMap()
        {
            //clave primaria y que sea autoincremental
            this.HasKey(tc => tc.Id);
            this.Property(tc => tc.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            //propiedades
            this.Property(tc => tc.Tipo)
                .HasColumnType("varchar")
                .HasMaxLength(20)
                .IsRequired();
            this.Property(tc => tc.Descripcion)
                .HasColumnType("varchar")
                .HasMaxLength(50)
                .IsRequired();
        }
    }
}
